/*------------------------------+
|	  Particle System Class		|
|	--------------------------	|
|	Manager that loads emitters,|
|	renders and updates them,	|
|	and controls their memory	|
+------------------------------*/

#pragma once

#include <vector>

class Emitter;

class ParticleSystem {

private:

	// Created emitters this class is managing
	std::vector<Emitter*> Emitters;

	// Loaded templates for the emitters
	std::vector<Emitter*> Templates;

	ParticleSystem();
	~ParticleSystem();

public:

	// Create a template emitter from a file. Returns a pointer to that template
	Emitter* LoadEmitterTemplate(std::string file);

	// Create an actual emitter for use in game
	Emitter* CreateEmitter(Emitter* master);

	// Destroy an emitter
	void DestroyEmitter(Emitter* emitter);

	// Activate an emitter
	void ActivateEmitter(Emitter* emitter, bool looping);

	// Stop a looping emitter
	void DeactivateEmitter(Emitter* emitter);

	// Return an instance of the manager
	static ParticleSystem* GetInstance(void);

	// Update all emitters
	void Update(float elapsedTime);

	// Render all emitters
	void Render(void);

	// Shutdown the System
	void Shutdown(void);
};
